<template>
    <div>
        <el-table :data="memberlist" border style="width: 100%" class="btnInfo">
            <el-table-column prop="uid" label="用户编号" width="80">
            </el-table-column>
            <el-table-column prop="nickname" label="昵称" width="180">
            </el-table-column>
            <el-table-column prop="phone" label="手机号" width="180">
            </el-table-column>
            <el-table-column label="状态">
                <template slot-scope="item">
                    <div>
                        <el-tag v-if='item.row.status == 1' type='success'>启用</el-tag>
                    </div>
                </template>
            </el-table-column>
            <el-table-column label="操作">
                <template slot-scope="item">
                    <div>
                        <el-button size="mini" @click="edit(item.row.uid)" type="primary" plain>编辑</el-button>
                    </div>
                </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
import { mapGetters, mapActions } from 'vuex'
export default {
    computed: {
        ...mapGetters({
            memberlist: 'member/getMemberList',
        })
    },
    mounted() {
        this.getMemberAction()
    },
    methods: {
        ...mapActions({
            getMemberAction: 'member/getMemberAction',
        }),
        edit(id) {
            this.$emit('edit', id)
        },
    }
}
</script>

<style scoped>
.btnInfo{
    margin: 20px 0px 5px 1px;
}
</style>